{% extends "common/layout_main.html" %}
{% block content %}
<div class="row  border-bottom">
    <div class="col-lg-12">
        <div class="tab_title">
            <ul class="nav nav-pills">
                <li class="current">
                    <a href="{{ url_for('food_page.index') }}">美食列表</a>
                </li>
                <li>
                    <a href="{{ url_for('food_page.category') }}">分类列表</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<style type="text/css">
    .wrap_info img {
        width: 70%;
    }
</style>
<div class="row m-t wrap_info">
    <div class="col-lg-12">
        <div class="row">
            <div class="col-lg-12">
                <div class="m-b-md">
                    <a class="btn btn-outline btn-primary pull-right" href="{{ url_for('food_page.edit') }}">
                        <i class="fa fa-pencil"></i> 编辑
                    </a>
                    <h2>美食信息</h2>
                </div>
            </div>
        </div>
        <div class="row" style="font-size:14px;">
            <div class="col-lg-12">
                <p class="m-t">名称：{{ food.name }}</p>
                <p>售价：{{ food.price }}</p>
                <p>今日库存：{{ food.stock }}</p>
                <p>标签：{{ food.tags }}</p>
                <p>图片：<img src="/static/images/food/{{ food.main_image }}" style="width: 50px;height: 50px;"></p>
                <p>描述：{{ food.summary }}</p>
                <p>月销售量：{{ food.month_count }}</p>
                <p>总销售量：{{ food.total_count }}</p>
            </div>
        </div>
        <div class="row m-t">
            <div class="col-lg-12">
                <div class="panel blank-panel">
                    <div class="panel-heading">
                        <div class="panel-options">
                            <ul class="nav nav-tabs">
                                <li class="active">
                                    <a href="#tab-1" data-toggle="tab" aria-expanded="false">销售历史</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab-1">
                                <table class="table table-striped">
                                    <thead>
                                    <tr>
                                        <th>会员名称</th>
                                        <th>购买数量</th>
                                        <th>购买价格</th>
                                        <th>订单时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% if sell_list %}
                                        {% for item in sell_list %}
                                        <tr>
                                            <td>{{ item.member_nickname }}</td>
                                            <td>{{ item.quantity }}</td>
                                            <td>{{ item.price }}</td>
                                            <td>{{ item.created_time }}</td>
                                        </tr>
                                       {% endfor %}
                                    {% else %}
                                    <tr>
                                        <td colspan="4">暂无销售记录</td>
                                    </tr>
                                    {% endif %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
